import Api from "@/api";

export default {
  state: {},
  getters: {},
  mutations: {},
  actions: {
    fetchAdminLink() {
      return Api.get("/admin/link");
    },
    saveLink(_, fromData) {
      return Api.post("/admin/link", fromData);
    },
    editLink(_, { formData, id }) {
      return Api.put("/admin/link/" + id, formData);
    },
    fetchBlogLink() {
      return Api.get("/link");
    },
    saveBlogLink(_, fromData) {
      return Api.post("/link", fromData);
    },
    changeStatus(_, { linkStatus, id }) {
      return Api.put("/admin/link/" + id, linkStatus);
    },
    deleteLink(_, id) {
      return Api.del("/admin/link/" + id);
    }
  }
};
